<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:a="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <h:form id="sevk" styleClass="edit">

        <rich:panel>
            <f:facet name="header">#{sevkHome.managed ? 'Edit' : 'Add'} Sevk</f:facet>

			<rich:layout>
              	<rich:layoutPanel position="left">

		            <s:decorate id="siraField" template="layout/edit.xhtml">
		                <ui:define name="label">Sira</ui:define>
		                <h:inputText id="sira" required="true" size="10" maxlength="10" value="#{sevkHome.instance.sira}">
		                    <a:support event="onblur" reRender="siraField" bypassUpdates="true" ajaxSingle="true"/>
		                </h:inputText>
		            </s:decorate>


		            <s:decorate id="seriField" template="layout/edit.xhtml">
		                <ui:define name="label">Seri</ui:define>
		                <h:inputText id="seri" required="true" size="2" maxlength="2" value="#{sevkHome.instance.seri}">
		                    <a:support event="onblur" reRender="seriField" bypassUpdates="true" ajaxSingle="true"/>
		                </h:inputText>
		            </s:decorate>

		            <s:decorate id="irsaliyenoField" template="layout/edit.xhtml">
		                <ui:define name="label">Irsaliyeno</ui:define>
		                <h:inputText id="irsaliyeno" required="true" size="20" maxlength="20" value="#{sevkHome.instance.irsaliyeno}">
		                    <a:support event="onblur" reRender="irsaliyenoField" bypassUpdates="true" ajaxSingle="true"/>
		                </h:inputText>
		            </s:decorate>

		            <s:decorate id="irsaliyeTarihiField" template="layout/edit.xhtml">
		                <ui:define name="label">Irsaliye tarihi</ui:define>
		                <rich:calendar id="irsaliyeTarihi" required="true" value="#{sevkHome.instance.irsaliyeTarihi}" datePattern="MM/dd/yyyy" />
		            </s:decorate>		
		            
		            <s:decorate id="sevkTarihiField" template="layout/edit.xhtml">
		                <ui:define name="label">Sevk tarihi</ui:define>
		                <rich:calendar id="sevkTarihi" required="true" value="#{sevkHome.instance.sevkTarihi}" datePattern="MM/dd/yyyy" />
		            </s:decorate>
    						            
				</rich:layoutPanel>

				<rich:layoutPanel position="center">				
		
		            <s:decorate id="teslimalanadsoyadField" template="layout/edit.xhtml">
		                <ui:define name="label">T.A. Ad Soyad</ui:define>
		                <h:inputText id="teslimalanadsoyad"
		                       required="true"
		                           size="50"
		                      maxlength="50"
		                          value="#{sevkHome.instance.teslimalanadsoyad}">
		                    <a:support event="onblur" reRender="teslimalanadsoyadField" bypassUpdates="true" ajaxSingle="true"/>
		                </h:inputText>
		            </s:decorate>
		
		
		            <s:decorate id="teslimedenadsoyadField" template="layout/edit.xhtml">
		                <ui:define name="label">T.E. Ad Soyad</ui:define>
		                <h:inputText id="teslimedenadsoyad"
		                       required="true"
		                           size="50"
		                      maxlength="50"
		                          value="#{sevkHome.instance.teslimedenadsoyad}">
		                    <a:support event="onblur" reRender="teslimedenadsoyadField" bypassUpdates="true" ajaxSingle="true"/>
		                </h:inputText>
		            </s:decorate>

					<s:decorate id="plakaField" template="layout/edit.xhtml">
		                <ui:define name="label">Plaka</ui:define>
		                <h:inputText id="plaka"
		                           size="10"
		                      maxlength="10"
		                          value="#{sevkHome.instance.plaka}">
		                    <a:support event="onblur" reRender="plakaField" bypassUpdates="true" ajaxSingle="true"/>
		                </h:inputText>
		            </s:decorate>
		
		            <s:decorate id="ehliyetnoField" template="layout/edit.xhtml">
		                <ui:define name="label">Ehliyetno</ui:define>
		                <h:inputText id="ehliyetno"
		                           size="20"
		                      maxlength="20"
		                          value="#{sevkHome.instance.ehliyetno}">
		                    <a:support event="onblur" reRender="ehliyetnoField" bypassUpdates="true" ajaxSingle="true"/>
		                </h:inputText>
		            </s:decorate>
		
		            <s:decorate id="ruhsatnoField" template="layout/edit.xhtml">
		                <ui:define name="label">Ruhsatno</ui:define>
		                <h:inputText id="ruhsatno"
		                           size="20"
		                      maxlength="20"
		                          value="#{sevkHome.instance.ruhsatno}">
		                    <a:support event="onblur" reRender="ruhsatnoField" bypassUpdates="true" ajaxSingle="true"/>
		                </h:inputText>
		            </s:decorate>
            
				</rich:layoutPanel>
			</rich:layout>

            <div style="clear:both">
                <span class="required">*</span>
                required fields
            </div>

        </rich:panel>

        <div class="actionButtons">

            <h:commandButton id="save"
                          value="Save"
                         action="#{sevkHome.persist}"
                       disabled="#{!sevkHome.wired}"
                       rendered="#{!sevkHome.managed}"/>

            <h:commandButton id="update"
                          value="Save"
                         action="#{sevkHome.update}"
                       rendered="#{sevkHome.managed}"/>

            <h:commandButton id="delete"
                          value="Delete"
                         action="#{sevkHome.remove}"
                      immediate="true"
                       rendered="#{sevkHome.managed}"/>

            <s:button id="cancelEdit"
                   value="Cancel"
             propagation="end"
                    view="/Sevk.xhtml"
                rendered="#{sevkHome.managed}"/>

            <s:button id="cancelAdd"
                   value="Cancel"
             propagation="end"
                    view="/#{empty sevkFrom ? 'SevkList' : sevkFrom}.xhtml"
                rendered="#{!sevkHome.managed}"/>

        </div>
    </h:form>

<rich:tabPanel switchType="ajax">

    <rich:tab label="Isemirharekets">
        <h:form styleClass="association" id="isemirhareketsChildren">

            <h:outputText value="There are no isemirharekets associated with this sevk."
                       rendered="#{empty sevkHome.isemirharekets}"/>

            <rich:dataTable value="#{sevkHome.isemirharekets}"
                           var="_isemirhareket"
                      rendered="#{not empty sevkHome.isemirharekets}"
                    rowClasses="rvgRowOne,rvgRowTwo"
                            id="isemirhareketsTable">
                <rich:column sortBy="#{_isemirhareket.id}">
                    <f:facet name="header">Id</f:facet>
                    <h:outputText value="#{_isemirhareket.id}"/>
                </rich:column>
                
                <rich:column sortBy="#{_isemirhareket.isemirByIsemirid.isemirno}">
                    <f:facet name="header">İş Emir No</f:facet>
                    <h:outputText value="#{_isemirhareket.isemirByIsemirid.isemirno}"/>
                </rich:column>
                
                <rich:column sortBy="#{_isemirhareket.harekettur.ad}">
                    <f:facet name="header">Hareket Turu</f:facet>
                    <h:outputText value="#{_isemirhareket.harekettur.ad}"/>
                </rich:column>
                
                <rich:column sortBy="#{_isemirhareket.isemirByVirmanisemirid.isemirno}">
                    <f:facet name="header">Virman İş Emir No</f:facet>
                    <h:outputText value="#{_isemirhareket.isemirByVirmanisemirid.isemirno}"/>
                </rich:column>
                
                <rich:column sortBy="#{_isemirhareket.isemirurun.urun.urunno}">
                    <f:facet name="header">Ürün</f:facet>
                    <h:outputText value="#{_isemirhareket.isemirurun.urun.urunno}-#{_isemirhareket.isemirurun.urun.adi}"/>
                </rich:column>
                
                <rich:column sortBy="#{_isemirhareket.isemirmalzeme.malzeme.kod}">
                    <f:facet name="header">Malzeme</f:facet>
                    <h:outputText value="#{_isemirhareket.isemirmalzeme.malzeme.kod}-#{_isemirhareket.isemirmalzeme.malzeme.ad}"/>
                </rich:column>

                <rich:column sortBy="#{_isemirhareket.miktar}">
                    <f:facet name="header">Miktar</f:facet>
                    <h:outputText value="#{_isemirhareket.miktar}"/>
                </rich:column>
            </rich:dataTable>

        </h:form>

        <f:subview rendered="#{sevkHome.managed}" id="isemirharekets">
        <div class="actionButtons">
            <s:button id="addisemirhareket"
                   value="Add isemirhareket"
                    view="/IsemirhareketEdit.xhtml"
             propagation="none">
                 <f:param name="sevkId"
                         value="#{sevkHome.instance.id}"/>
                 <f:param name="isemirhareketFrom" value="Sevk"/>
            </s:button>
        </div>
        </f:subview>
    </rich:tab>
</rich:tabPanel>
</ui:define>

</ui:composition>
